home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Interactive 1
/
CD-Rom Interactive (magazine) coverdisc (Disc 1, October, 1994).iso
/
QT
/
SETUP.MST
< prev
next >
Wrap
Text File
|
1994-07-18
|
18KB
|
501 lines
rem ---------------------------------------------------------------------
rem
rem SETUP.MST - MSSETUP Installation Script
rem
rem Version 1.0
rem
rem (c) 1988-1992 Apple Computer, Inc. All Rights Reserved.
rem
rem ---------------------------------------------------------------------
rem ---------------------------------------------------------------------
rem
rem Adapted slightly for the DK Sampler Disc setup, to avoid (c) infringement
rem and to avoid supporting things DK doesn't support (e.g. French).
rem
rem ---------------------------------------------------------------------
rem Required includes to interface with MSSETUP DLL's
rem -------------------------------------------------
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
rem Dialog box id's
rem ---------------
rem Note: If MSSETUP were really smart, we could use the
rem #defines in DIALOGS.HR. Instead, we must manually
rem keep them in step
rem ----------------------------------------------------
CONST DESTPATH = 300 ''Gets destination path
CONST EXITQUIT = 600 ''Exits on user request
CONST EXITSUCCESS = 700 ''Exits when install is done
CONST OPTIONS = 800 ''Gets AUTOEXEC.BAT options
CONST ASKSETUP = 1100 ''Gets installation type (Local etc)
CONST TOOBIG = 6300 ''Not enough space on target disk error
CONST BADPATH = 6400 ''Bad destination path error
CONST BADWINDOWS = 6500 ''Wrong Windows release
CONST EXITFAILURE = 6600 ''Exits on error
rem String id's
rem -----------
rem Note: If MSSETUP were really smart, we could use the
rem #defines in DIALOGS.HR. Instead, we must manually
rem keep them in step
rem ----------------------------------------------------
CONST STR_PLAYER = 1024 ''Movie Player
CONST STR_VIEWER = 1025 ''Picture Viewer
CONST STR_GROUP = 1026 ''Program Manager group
CONST STR_TITLE = 1027 ''Installer Title
CONST STR_MSG1 = 1028 ''Version error message part 1
CONST STR_MSG2 = 1029 ''Version error message part 2
CONST STR_MSG3 = 1030 ''Remove obsolete files?
CONST STR_WARNING = 1031 ''Warning
CONST STR_HELP = 1032 ''Help
rem Miscellaneous Constants
rem -----------------------
CONST NOLOGO = 1 ''Dummy NULL bitmap (must be 1)
CONST LOGO = 2 ''Background bitmap
CONST MOVIE = 2 ''Movie placeholder bitmap
CONST NOSPACE = 1 ''No space to complete install
CONST INSTALLOK = 2 ''Install completed OK
CONST INSTALLFAILED =3 ''Install failed for some reason
rem Global Variables
rem ----------------
GLOBAL SOURCE$ ''Source directory
GLOBAL DEST$ ''Default destination directory
GLOBAL SETUPTYPE$ ''Setup type (Local, Client, Server)
GLOBAL LOCALINST$ ''Local install
GLOBAL CLIENTINST$ ''Client install
GLOBAL SERVERINST$ ''Server install
GLOBAL MODAUTOEXECOPT$ ''Modify AUTOEXEC.BAT option
GLOBAL MODAUTOEXEC$ ''Modify AUTOEXEC.BAT
GLOBAL COPYAUTOEXEC$ ''Copy AUTOEXEC.BAT and modify it
GLOBAL CUIDLL$ ''User interface DLL
GLOBAL SETUPPATH$ ''Setup destination path
GLOBAL HELPPROC$ ''Help dialog procedure
GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive
GLOBAL APPNEEDS$ ''Disk space costs per drive
GLOBAL SECTIONKEY$ ''INF file section key
GLOBAL SUCCESS% ''Installation completion code
rem Initialize global vriables
rem --------------------------
LOCALINST$ = "1"
CLIENTINST$ = "2"
SERVERINST$ = "3"
MODAUTOEXEC$ = "1"
COPYAUTOEXEC$ = "2"
SETUPPATH$ = "C:\QTW"
SETUPTYPE$ = LOCALINST$
SOURCE$ = GetSymbolValue("STF_SRCDIR")
DEST$ = SETUPPATH$
MODAUTOEXECOPT$ = MODAUTOEXEC$
SUCCESS% = INSTALLFAILED
EXTRACOSTS$ = "ExtraCosts"
APPNEEDS$ = "AppNeeds"
SECTIONKEY$ = "SectionKey"
FOR i% = 1 TO 26 STEP 1
AddListItem EXTRACOSTS$, "16384"
NEXT i%
rem Get name of localized user interface dialogs
rem --------------------------------------------
rem CUIDLL$ = "SETUP"+GetIniKeyString("WIN.INI", "intl", "sLanguage")+".DLL"
rem IF DoesFileExist(CUIDLL$, femExists) = 0 THEN
CUIDLL$ = "SETUPENU.DLL"
rem END IF
rem Subroutines and Functions
rem -------------------------
DECLARE FUNCTION Install AS INTEGER
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetQTWVersion LIB "setupenu.dll" (szDLL$) AS INTEGER
DECLARE FUNCTION GetResourceString LIB "setupenu.dll" (szResource$, idString%) AS INTEGER
DECLARE FUNCTION StartCustomSetup LIB "setupenu.dll" (hinst%, hwnd%) AS INTEGER
DECLARE FUNCTION StopCustomSetup LIB "setupenu.dll" (hinst%, hwnd%) AS INTEGER
DECLARE FUNCTION UpdateAutoExecBat LIB "setupenu.dll" (szIn$, szOut$, szDest$) AS INTEGER
DECLARE FUNCTION WritePrivateProfileString LIB "krnl386.exe" (szSect$, szEntry$, szString$, szINI$) AS INTEGER
rem Initialize custom setup logic
rem -----------------------------
SetBitmap CUIDLL$, NOLOGO
i% = GetResourceString (CUIDLL$, STR_TITLE)
SetTitle GetSymbolValue ("ResourceString")
i% = StartCustomSetup (HinstFrame(), HwndFrame ())
i% = SetBeepingMode(1)
rem Make sure that we are running on Windows 3.1 or better
rem ------------------------------------------------------
IF GetWindowsMajorVersion() < 3 THEN
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", 0, "")
UIPop 1
GOTO CLEANUP
END IF
IF (GetWindowsMajorVersion() = 3) AND (GetWindowsMinorVersion() < 10) THEN
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", 0, "")
UIPop 1
GOTO CLEANUP
END IF
rem Make sure that we are running on a 286 or better
rem ------------------------------------------------
IF GetWinFlags() AND 2 THEN
sz$ = UIStartDlg(CUIDLL$, BADWINDOWS, "FInfo0DlgProc", 0, "")
UIPop 1
GOTO CLEANUP
END IF
rem Find and read the .INF file. We'll use DISKETTE.INF when installing
rem from drive A: or B:, CD.INF otherwise.
rem -------------------------------------------------------------------
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szTemp$ = GetSymbolValue("STF_SRCDIR")
SPLITPATH szTemp$, drv$, dir$, filename$, ext$
rem IF (drv$ = "A:") OR (drv$ = "B:") THEN
rem szInf$ = szTemp$ + "DISKETTE.INF"
rem ELSE
szInf$ = szTemp$ + "CD.INF"
END IF
ReadInfFile szInf$
rem Get the setup type: Local, Client or Server
rem -------------------------------------------
ITYPE:
SetSymbolValue "RadioDefault", SETUPTYPE$
ITYPEL1:
sz$ = UIStartDlg(CUIDLL$, ASKSETUP, "FRadioDlgProc", 0, "")
SETUPTYPE$ = GetSymbolValue("ButtonChecked")
IF sz$ = "CONTINUE" THEN
UIPop(1)
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ITYPEL1
ELSE
GOSUB ASKQUIT
GOTO ITYPE
END IF
rem Get the AUTOEXEC.BAT modification option
rem ----------------------------------------
OPTIONC:
IF SETUPTYPE$ = SERVERINST$ THEN
GOTO GETPATH
END IF
SetSymbolValue "RadioDefault", MODAUTOEXECOPT$
OPTL1:
sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", 0, "")
MODAUTOEXECOPT$ = GetSymbolValue("ButtonChecked")
IF sz$ = "CONTINUE" THEN
UIPop(1)
ELSEIF sz$ = "REACTIVATE" THEN
GOTO OPTL1
ELSEIF sz$ = "BACK" THEN
UIPop